from django.shortcuts import render

# Create your views here.
from rest_framework.generics import ListAPIView
from .models import Banner,Nav
from .serializers import BannerModelSerializer,NavModelSerializer
from luffyapi.settings import constant
class BannerListAPIView(ListAPIView):
    queryset = Banner.objects.filter(is_show=True, is_delete=False).order_by("-orders","-id")[:constant.HOME_BANNER_LENGTH]
    serializer_class = BannerModelSerializer

class HeaderNavListAPIView(ListAPIView):
    queryset = Nav.objects.filter(is_show=True,is_delete=False,position=0).order_by('orders','-id')[:constant.HOME_HEADER_LENGTH]
    serializer_class = NavModelSerializer

class FooterNavListAPIView(ListAPIView):
    queryset = Nav.objects.filter(is_show=True,is_delete=False,position=1).order_by('orders','-id')[:constant.HOME_FOOTER_LENGTH]
    serializer_class = NavModelSerializer